package com.zzt.springbootdemo.controller;

import com.zzt.springbootdemo.model.MessageInfo;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 * Description
 * User: panda
 * Date: 2025-02-09
 * Time: 18:40
 */
@RestController
@RequestMapping("/user2")
public class UserController2 {

    //既支持get，又支持post
    @RequestMapping(value = "/m1", method = {RequestMethod.GET,RequestMethod.POST})
    //@RequestMapping("/m1")
    public String m1(){
        //com.zzt.spring.demo.UserController#m1()
        return "m1";
    }

    //只支持get
    @RequestMapping(value = "/m2",method = RequestMethod.GET)
    public String m2(){
        return "m2";
    }

    //只支持post
    @RequestMapping(value = "/m3", method = RequestMethod.POST)
    public String m3(){
        return "m3";
    }

    //只支持get
    @GetMapping("/m4")
    public String m4(){
        return "m4";
    }

    @PostMapping("/m4")
    public String m5(){
        return "m5";
    }

    public void testLombok(){
        MessageInfo messageInfo = new MessageInfo();
//        messageInfo.setMessage("");
    }
}
